package guda.house.biz.form.village;

import guda.house.dal.dataobject.EstateDO;

import javax.validation.constraints.NotNull;

/**
 * Created by well on 15/11/13.
 */
public class EstateEditForm extends EstateForm {

    @NotNull(message = "不能为空")
    private Long estateId;

    public void initForm(EstateDO estateDO){
        setEstateId(estateDO.getEstateId());
        setEstateName(estateDO.getEstateName());
        setContactUser(estateDO.getContactUser());
        setContactPhone(estateDO.getContactPhone());
    }

    public EstateDO toDO() {
        EstateDO estateDO = super.toDO();
        estateDO.setEstateId(estateId);
        return estateDO;
    }

    public Long getEstateId() {
        return estateId;
    }

    public void setEstateId(Long estateId) {
        this.estateId = estateId;
    }
}
